package com.vcredit.creditcat.service;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.vcredit.creditcat.util.Constants;
import com.vcredit.framework.annotation.Log;
import com.vcredit.framework.util.HttpRequest;

@Service
public class SendSmsService {
	@Value("${send.sms.url}")
	private String sendSmsUrl;

	/**
	 * 通知类短信发送接口
	 * 
	 * @param sms_mobile
	 * @param sms_content
	 * @return
	 * @throws Exception
	 */
	@Log
	public String sendSms(String sms_mobile, String sms_content, String typeName, String sign) throws Exception {
		SmsMessageData messageData = new SmsMessageData();
		messageData.setOperationUserID(Constants.SMS_OPERATIONUSERID);
		messageData.setMessageContent(sms_content);
		messageData.setMobile(sms_mobile.trim());
		messageData.setSignStr(sign);
		messageData.setSmsSource(Constants.SMS_SOURCE);
		messageData.setSmsTypeName(typeName);
		messageData.setCustomerType(Constants.SMS_CUSTOMERYPTYPE);
		return HttpRequest.doJson(sendSmsUrl, messageData);
	}
}
